package fes.ui;

import com.ht.aems.swing.util.SwingUtil;
import org.javabuilders.swing.SwingJavaBuilder;

import javax.swing.*;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author: Yanxue
 * Date: 2011-3-14
 */
public class UnfoldWindow extends JDialog {
    String infoStr;
    JTextArea showArea;

    public UnfoldWindow(String showInfo){
        SwingJavaBuilder.build(this);
        showArea.setLineWrap(true);
        showArea.setText(showInfo);
        setInfoStr(showInfo);
        setAlwaysOnTop(true);
        setLocationRelativeTo(null);
        setSize(300,300);
    }

    public void closeAction(){
        setInfoStr(showArea.getText());
        dispose();
    }

    public void setInfoStr(String infoStr){
        this.infoStr = infoStr;
    }

    public String getInfoStr(){
        return infoStr;
    }

    public static void main(String[] args) {
        UnfoldWindow unfold = new UnfoldWindow("");
        SwingUtil.centerWindow(unfold);
        unfold.setVisible(true);
    }
}